package com.webware.view.client.app.view;

import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.IsWidget;
import com.google.gwt.user.client.ui.SimpleLayoutPanel;
import com.google.gwt.user.client.ui.Widget;
import com.google.inject.Inject;
import com.webware.view.client.app.presenter.interfaces.IAppView;
import com.webware.view.client.app.presenter.interfaces.IAppView.IAppPresenter;

public class AppView extends ReverseCompositeView<IAppPresenter> implements
	IAppView {

    private static AppViewUiBinder uiBinder = GWT.create(AppViewUiBinder.class);

    @UiField
    protected SimpleLayoutPanel headerLayout;
    @UiField
    protected SimpleLayoutPanel bodyLayout;

    protected interface AppViewUiBinder extends UiBinder<Widget, AppView> {
    }

    @Inject
    public AppView(HeaderView header) {
	initWidget(uiBinder.createAndBindUi(this));
	setHeader(header);
    }

    @Override
    public void setHeader(IsWidget header) {
	headerLayout.setWidget(header);
    }

    @Override
    public void setBody(IsWidget body) {
	bodyLayout.setWidget(body);
    }
}
